#ifndef _SOCKET_HPP_GUARD__
#define _SOCKET_HPP_GUARD__

#include <iostream>
#include <WinSock2.h>
#pragma comment (lib,"ws2_32.lib")

class Socket {
	sockaddr_in		service_;
	SOCKET			hSocket_;
	ADDRESS_FAMILY	addressFamily_;
	USHORT			protocol_;

public:
	Socket();
	Socket( const Socket& socket );
	Socket( ADDRESS_FAMILY addressFamily, USHORT protocol );
	~Socket();
	void			WSAStart();
	bool			Accept( Socket &clientSocket );
	bool			Bind( std::string address, int port );
	bool			Listen();
	bool			Connect( std::string address, int port );
	int				Send( const char* sendbuf );
	int				Receive( char* recvbuf, int len );
	int				SendTo();
	int				ReceiveFrom();
	void			Close();
};

#endif